<template>
  <div class="app-container">
    <qm-table
      :data="query"
      keyProp="commentId"
      :showView="false"
      :showOrder="false"
      menuType="text"
      :formOptions="{ labelWidth: '120px' }"
      :menuOptions="{ width: 100 }"
      :rules="rules"
    >
      <qm-table-column field="sort" width="90">序号</qm-table-column>
      <qm-table-column field="content">意见内容</qm-table-column>
      <template v-slot:form="{ model, viewModel }">
        <el-row>
          <el-col :span="12">
            <el-form-item label="排序：" prop="model.sort">
              <el-input v-model.number="model.sort"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="意见内容：" prop="model.content">
              <el-input
                type="textarea"
                :autosize="{ minRows: 5, maxRows: 100}"
                v-model="model.content"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="viewModel.pageAction === 'view'">
          <el-col :span="12">
            <el-form-item label="创建时间：" prop="model.createdDate">
              <el-date-picker type="datetime" v-model="model.createdDate" style="width: 100%"></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="更新时间：" prop="model.updatedDate">
              <el-date-picker type="datetime" v-model="model.updatedDate" style="width: 100%"></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
      </template>
    </qm-table>
  </div>
</template>
<script>
import Controller from "@/libs/framework/controller";
import request from "@/utils/request";
export default class Instance extends Controller {
  onBeforeInit() {
    this.urls = {
      query: [{ url: "/workflow/actExtCommonComment/query", method: "post" }],
      save: "/workflow/actExtCommonComment/save",
      delete: "/workflow/actExtCommonComment/delete",
      entity: "/workflow/actExtCommonComment/getEntity",
    };
  }
  onBeforeGetEntity(params) {
    params.version = "1";
  }
  onInit() {
    // this.setRequestParam("length", 2);
  }
  mixin() {
    return {
      data() {
        return {
          rules: {
            model: {
              content: [
                {
                  required: true,
                  message: "这是必填字段",
                  trigger: "blur",
                },
              ],
              sort: [
                { type: "number", message: "排序必须为数字值" },
                {
                  required: true,
                  message: "这是必填字段",
                  trigger: "blur",
                },
              ],
            },
          },
        };
      },
      created() {},
      methods: {},
    };
  }
}
</script>

<style scoped lang="scss">
</style>

